export default defineStore("blog", {
	persist: true,
	state: () => {
		return {
			userinfo: {},
			type: [],
			label: [],
			token: ""
		};
	},
	actions: {
		setToken(token: string) { this.token = token },
		setUserInfo(userinfo: { username: string, avatar: string, email: string, id: number }) {
			this.userinfo = userinfo
		}
	},
	getters: {
		getUserinfo: (state) => state.userinfo,
		getType: (state) => state.type,
		getLabel: (state) => state.label,
		getToken: (state) => state.token
	}
});